package com.foreknow.homework.person;

import java.util.Scanner;

public class Person {
    private String name;
    private double height;
    private double weight;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    public double getWeight() {
        return weight;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }

    public Person(String name, double height, double weight) {
        this.name = name;
        this.height = height;
        this.weight = weight;
    }

    public void sayHello(){
        System.out.println("1 or 2");
        Scanner input=new Scanner(System.in);
        int choo=input.nextInt();
        if (choo==1){
            System.out.println("hello,my name is "+getName()+
                    "  身高是："+getHeight()+"  体重是："+getWeight());
        }else if(choo==2)
            System.out.println("hello,my name is "+getName()+
                    "  身高是："+getHeight()+"  体重是："+getWeight());
    }

    public static void main(String[] args) {
        Person p1=new Person("zhangsan",175,140);
        Person p2=new Person("lishi",170,132);
        p1.sayHello();
        p2.sayHello();
    }
}
